﻿using System.Windows.Media;
using System.Collections.ObjectModel;

namespace MyFloridaHouse.libSvUtilities.CustomColors
{
    public class NamedColors
    {

        public static ObservableCollection<string> CreateColorList()
        {
            ObservableCollection<string> colorList = new ObservableCollection<string>();
            colorList.Add("BLUE");
            colorList.Add("BROWN");
            colorList.Add("CYAN");
            colorList.Add("GRAY");
            colorList.Add("GREEN");
            colorList.Add("MAGENTA");
            colorList.Add("ORANGE");
            colorList.Add("PURPLE");
            colorList.Add("RED");
            colorList.Add("YELLOW");
            colorList.Add("TRANSPARENT");
            return colorList;
        }

        public static SolidColorBrush ConvertStringToColor(string colorToConvert)
        {
            // todo: figure out a more generic way to do this
            switch (colorToConvert)
            {
                case "BLUE":
                    return new SolidColorBrush(Colors.Blue);
                case "BROWN":
                    return new SolidColorBrush(Colors.Brown);
                case "CYAN":
                    return new SolidColorBrush(Colors.Cyan);
                case "GRAY":
                    return new SolidColorBrush(Colors.Gray);
                case "GREEN":
                    return new SolidColorBrush(Colors.Green);
                case "MAGENTA":
                    return new SolidColorBrush(Colors.Magenta);
                case "ORANGE":
                    return new SolidColorBrush(Colors.Orange);
                case "PURPLE":
                    return new SolidColorBrush(Colors.Purple);
                case "RED":
                    return new SolidColorBrush(Colors.Red);
                case "YELLOW":
                    return new SolidColorBrush(Colors.Yellow);
                case "TRANSPARENT":
                    return new SolidColorBrush(Colors.Transparent);
                default:
                    return new SolidColorBrush(Colors.Red);

            }
        }
    }
}
